package com.itbupt.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import com.itbupt.infrastructure.persistent.po.RaffleActivityAccount;
import org.apache.ibatis.annotations.Mapper;

/**
 * @Author dingchang
 * @Date 2025/3/30 15:47
 * @Description: 抽奖活动账户表
 */

@Mapper
public interface IRaffleActivityAccountDao {


    /**
     * 更新抽奖活动账户表
     * @param raffleActivityAccount 抽奖活动账户表
     * @return 影响行数
     */
    int updateAccountQuota(RaffleActivityAccount raffleActivityAccount);

    /**
     * 新建一条抽奖活动账户记录
     * @param raffleActivityAccount
     */
    void insert(RaffleActivityAccount raffleActivityAccount);

    /**
     * 更新总账户的次数（总次数，月次数，日次数）
     * @param raffleActivityAccount
     * @return 影响行数
     */
    int updateActivityAccountSubtractionQuota(RaffleActivityAccount raffleActivityAccount);

    /**
     * 更新总账户中月镜像库存
     * @param raffleActivityAccount
     */
    void updateActivityAccountMonthSubtractionQuota(RaffleActivityAccount raffleActivityAccount);

    /**
     * 更新总账户中日镜像库存
     * @param raffleActivityAccount
     */
    void updateActivityAccountDaySubtractionQuota(RaffleActivityAccount raffleActivityAccount);

    /**
     * 更新总账表中月镜像额度
     * @param raffleActivityAccount
     */
    void updateActivityAccountMonthSurplusImageQuota(RaffleActivityAccount raffleActivityAccount);

    /**
     * 更新总账表中日镜像额度
     * @param raffleActivityAccount
     */
    void updateActivityAccountDaySurplusImageQuota(RaffleActivityAccount raffleActivityAccount);

    /**
     * 查询抽奖活动信息
     * @param raffleActivityAccountReq
     * @return RaffleActivityAccount
     */
    @DBRouter
    RaffleActivityAccount queryActivityAccountByUserId(RaffleActivityAccount raffleActivityAccountReq);

    /**
     * 获取指定抽奖账户信息
     * @param raffleActivityAccount 抽奖账户
     * @return
     */
    RaffleActivityAccount queryAccountByUserId(RaffleActivityAccount raffleActivityAccount);


}
